<%@ page language="java" contentType="text/html; charset=utf-8" import="net.fckeditor.*" import="com.hykj.valuebean.*"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<html>
<head>
<script type="text/javascript">
	function FCKeditor_OnComplete(editorInstance) {
		window.status = editorInstance.Description;
	}

	
</script>

<link rel="stylesheet" type="text/css" href="/hykj/css/header.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>更新产品</title>
</head>
<%
	FCKeditor fckEditor = new FCKeditor(request, "introduction");
	fckEditor.setWidth("800");
	fckEditor.setHeight("400");
%>
<body>
<center><jsp:include page="/admin/head.jsp" />
<table width="944">
	<tr>
		<td width="744" align="left">
		
		<c:set var="single" value="${requestScope.single}" /> 
		<c:if test="${empty single}">查看详细信息失败！</c:if> 
		<c:if test="${!empty single}">
		<form name="product" action="updateProduct?id=${single.id }" method="post" enctype="multipart/form-data">
			<table>
				<tr><td><input type="hidden" name="id" value="${single.id }"></input></td></tr>
				<tr>
				<td width="100" height="20">是否首页显示:</td>
				<td id="fro">
					<select name="front">
						<option value="0">否</option>
						<option value="1">是</option>
					</select>
				</td>
			</tr>
				<tr>
				<td width="100" height="20"><b>游戏名称:</b></td>
				<td><input name="title" type="text" value="${single.title }" maxlength="50"></input></td>
			</tr>
			<tr>
				<td width="100" height="20"><b>首页图片地址：</b></td>
				<td id="more"><input name="indexDir" type="file" maxlength="20"></td>
			</tr>
			<tr>
				<td><input name="indexDirHide" type="hidden" value="${single.indexDir }"></input></td>
			</tr>
			<tr>
				<td colspan="2"><img width="155" height="116" src="/hykj/${single.indexDir }"></img></td>
			</tr>
			<tr>
				<td width="100" height="20"><b>GIF图片地址：</b></td>
				<td id="more"><input name="gifDir" type="file" maxlength="20"></td>
			</tr>
			<tr>
				<td><input name="gifDirHide" type="hidden" value="${single.gifDir }"></input></td>
			</tr>
			<tr>
				<td colspan="2"><img width="155" height="116" src="/hykj/${single.gifDir }"></img></td>
			</tr>
			<tr>
				<td width="100" height="20"><b>大图图片地址：</b></td>
				<td id="more"><input name="bigDir" type="file" maxlength="20"></td>
			</tr>
			<tr>
				<td><input name="bigDirHide" type="hidden" value="${single.bigDir }"></input></td>
			</tr>
			<tr>
				<td colspan="2"><img width="155" height="116" src="/hykj/${single.bigDir }"></img></td>
			</tr>
			<tr>
				<td width="100" height="20"><b>游戏类型：</b></td>
				<td width="434"><input name="argument" type="text" value="${single.argument }"
					maxlength="50"></td>
			</tr>
			<tr>
				
				<td width="75" height="20"><b>类别:</b></td>
				<td width="434" id="cate"><select name="category">
					<option value="0">java</option>
					<option value="1">Symbian</option>
					<option value="2">iPhone </option>
					<option value="3">Android</option>
				</select></td>
			</tr>
			
			
			<tr>
				<td width="100" height="20"><b>简单描述:</b></td>
				<td><textarea name="describes" rows="3" cols="50">${single.describes }</textarea></td>
			</tr>
			
			
			<tr>
				<td width="434" colspan = "2" align="left">
				<b>详细说明：</b><br></br>
				<%
					products productsIns = (products)request.getAttribute("single");
					String ab = productsIns.getIntroduction();
					fckEditor.setValue(ab);
					out.println(fckEditor);
				%> <br />
				</td>
			</tr>

			


			<tr>
				<td height="20">&nbsp;</td>
				<td><input type="submit" name="Submit" value="上传">
				&nbsp;&nbsp; <input type="reset" name="Submit2" value="重置">
				</td>
			</tr>
			</table>
			
			<script type="text/javascript">
			var list=document.getElementById("cate").getElementsByTagName("select")[0];
			list.selectedIndex="${single.category }";

			</script>
			<script type="text/javascript">
			var list=document.getElementById("fro").getElementsByTagName("select")[0];
			list.selectedIndex="${single.front }";

			</script>
			
		</form>
		</c:if>
		</td>
		<td width="200"></td>
	</tr>
</table>
<jsp:include page="/admin/foot.jsp" /></center>
</body>
</html>